﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CSCodeLib.Helpers
{
    static class ListHelper
    {
        public static T Pop<T>(this List<T> list)
        {
            if (list.Count == 0)
                return default(T);
            T t = list[0];
            list.RemoveAt(0);
            return t;
        }
        public static void Push<T>(this List<T> list, T value)
        {
            list.Insert(0, value);
        }
        public static bool IsEmpty<T>(this List<T> list)
        {
            return list.Count == 0;
        }
    }
}
